package com.leyou.item.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.leyou.item.entity.Category;
import com.leyou.item.mapper.CategoryMapper;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class CategoryService extends ServiceImpl<CategoryMapper,Category> implements com.leyou.item.service.CategoryService {

    @Override
    public List<Category> findCategoryByPid(Long pid) {
        //List<Category> categories = getBaseMapper().findCategoryByPid(pid);
//        List<CategoryDTO> categoryDTOS = CategoryDTO.convertEntityList(categories);
        List<Category> categories = query().eq("parent_id", pid).list();
        return categories;
    }

    @Override
    public List<Category> queryByBrandId(Integer bid) {
        List<Category> categories = getBaseMapper().queryByBrandId(bid);
        return categories;
    }

    @Override
    public List<Category> queryListByIds( List<Long> ids) {
        List<Category> categories = listByIds(ids);
        return categories;
    }
}
